<div class="clearfix">
	<div class="f_l res_gre_bias_tit">
        <b class="gre_v_line1"></b><b class="gre_v_line2"></b>
        <h3 class="res_gre_bias_main">餐厅菜单</h3>
    </div>
    <!-- 搜索小框 -->
    <span class="f_l ml20 pl20" style="color:#a4a4a4">搜索：<input type="search" id="choFoodSchInput" class="text res_cho_search" value="{$keyword}" placeholder="菜名、主要成分..."><a href="javascript:void(0);" class="rel" id="choFoodSchBtn" rel="nofollow"><span class="icons i007"></span></a>
        <span class="ml20">餐厅菜单仅供参考，实际以餐厅公布的价格为准。</span>
    </span>
</div>
<div class="res_cho_box">
	<b class="res_cho_line"></b>
    <div class="clearfix ">
		<div class="res_cho_left">
		    <div class="equal_height bgwh brc"></div>
		    <ul class="res_cho_menu clearfix">
		    	<li><a href="javascript:set_store_menu('id','DESC',0);" name="resChoLink" class="res_cho_link {if $is_special eq 0}res_cho_link_on{/if}" data-id="all">全部</a></li>
				<li><a href="javascript:set_store_menu('id','DESC',1);" name="resChoLink" class="res_cho_link {if $is_special eq 1}res_cho_link_on{/if}" data-id="is_special">特色菜</a></li> 
				{foreach from=$menu_cate_list item=item_list}
				<li><a href="javascript:set_store_menu('id','DESC',0,{$item_list.cate_id});" name="resChoLink" title="{$item_list.title}"class="res_cho_link {if $cate_id eq $item_list.cate_id}res_cho_link_on{/if}" data-id="cate_id">{$item_list.name}</a></li>   
		    	{/foreach}
			</ul>
		</div>
        <div id="foodListOut" class="f_r cell pb10">
        	{if $list}
        	<ul class="clearfix  res_cho_list_title">
        		<li class="f_l pct33">菜名</li>
				<li class="f_l pct20 tc fs"><a href="javascript:set_store_menu('price','{$sort}',{$is_special});" class="g3 mr5 choListSort" title="点击按价格升序排列" data-sort="A1">价格(元){if $field eq 'price'}{if $sort eq 'ASC'}↓{else}↑{/if}{/if}</a></li>
				<li class="f_l pct15 tc g3 fs"><a href="javascript:set_store_menu('collect_nums','{$sort}',{$is_special});" class="g3 choListSort" title="按人气排序" data-sort="D2">人气{if $field eq 'collect_nums'}{if $sort eq 'ASC'}↓{else}↑{/if}{/if}</a></li>
				<li class="f_l pct25 tc">数量/操作</li>
			</ul>
			{foreach from=$list item="item"}
			<ul class="clearfix res_cho_list" data-hover="true" data-id="{$item.id}">
				<div class="clearfix">
				<li class="f_l pct33">
					<a href="javascript:void(0);" target="_blank" class="g3 res_cho_tit_a db">{$item.name}</a>
				</li>
				<li class="f_l pct20 tc g6">{function name="format_price" v=$item.price}</li>
				<li class="f_l pct15 tc g6">{$item.collect_nums}</li>
				<li class="f_l pct25 tc opt">
					
				</li>
				</div>
				<div class="clearfix">
				<li class="clearfix f_l">
					<a target="_blank" href="javascript:void(0);"><img width="110" class="res_cho_img" src="{if $item.preview}{function name="get_spec_image" v=$item.preview w=110 h=110 g=1}{/if}"></a>
					<p class="g9 res_cho_descr f_l">{$item.brief}<br></p>
				</li>
				</div>
			</ul>
			{/foreach}
			<div class="blank"></div>
	        <div class="res_cho_page clearfix">
	      	  <div class="pages">{$pages}</div>
	        </div>
			{else}
			<div class="mt10 mr10 bgwh">
                <div class="nodata res_sch_no_data">
                    <h3 class="fw f20">没有找到符合要求的菜品</h3>
                    <ul class="c8 lh22 mt5">
                        <li>请检查输入的字词有无错误</li>
                        <li>适当删减或更改搜索关键词</li>
                        <li>适当减少已选择的条件</li>
                    </ul>
                </div>
                
            </div>
			{/if}
		</div>
		
   	</div>               
</div>
<script type="text/javascript">
	function set_store_menu(field,sort,is_special,cate_id){
		var query = new Object();
		query.ctl = "view",
		query.act = "ajax_get_menu"
		query.id = "{$id}";
		query.cate_id = cate_id;
		query.is_special = is_special;
		query.count = "{$count}";
		query.field = field;
		query.sort = sort;
		query.is_ajax = 1;
		query.p = 1;
		$.ajax({
			url:APP_ROOT + "/store.php",
			data:query,
			type:"POST",
			dataType:"text",
			cache:false,
			success:function(result){
				$("#ul-store-menu").html(result);
			}
		});
	}
	function store_get_menu_search(){
		if($.trim($("#choFoodSchInput").val())!=""){
			var query = new Object();
			query.ctl = "view",
			query.act = "ajax_get_menu"
			query.id = "{$id}";
			query.count = "{$count}";
			query.field = "{$field}";
			query.sort = "{$sort}";
			query.is_ajax = 1;
			query.p = 1;
			query.keyword = $.trim($("#choFoodSchInput").val());
			$.ajax({
			url:APP_ROOT + "/store.php",
			data:query,
			type:"POST",
			dataType:"text",
			cache:false,
			success:function(result){
				$("#ul-store-menu").html(result);
			}
		});
		}
	}
	jQuery(function(){
		$("#ul-store-menu .pages a").click(function(){
			var url = $(this).attr("href");
			$.ajax({
				url:url,
				dataType:"text",
				cache:false,
				success:function(result){
					$("#ul-store-menu").html(result);
				}
			});
			return false;
		});
		$("ul.res_cho_list").hover(function(){
			$(this).addClass("res_cho_list_hover");
		},function(){
			$(this).removeClass("res_cho_list_hover");
		});
		$("#choFoodSchBtn").click(function(){
			store_get_menu_search();
			return false;
		});	
		$("#choFoodSchInput").keydown(function(e){
			if(e.keyCode==13){
			  store_get_menu_search();
			  return false;
			}
		});
		load_ctmenu_nums_list();
	});
</script>